package StudyCode.summary.BufferAndChannel;

import java.nio.ByteBuffer;
import java.nio.CharBuffer;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class UsingByteBufferStoreStrings {
	public static void main(String[] args) {
		ByteBuffer buf = ByteBuffer.allocate(100);

		CharBuffer cbuf = buf.asCharBuffer();

		cbuf.put("www.tah1986.com");
		cbuf.flip();
		String s = cbuf.toString();
		System.out.println("ByteBuffer 输出存储的String");
		System.out.println(s);

	}
}
